﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace ChallengePuzzle.Lib
{
    /// <summary>
    /// 主类，输入范围，返回范围之内的幸运数列表
    /// </summary>
    public class Lucky
    {

         LuckyNumbers luckyNumbers = new LuckyNumbers();
            
         Judger judger = new Judger();

        public LuckyNumbers SearchLuckyNumbers(int X,int Y)
        {

            for (int i = X; i <= Y; i++)
            {
                PickLuckyNumber(i);
            }

            return luckyNumbers;
        }

        private void PickLuckyNumber(int i)
        {
            if (judger.IsLuckyNumber(i)) luckyNumbers.Add(i);
        }
    }
}
